# Flight Booking System - Shared Hosting Installation Guide

This guide helps non-technical users install this  flight booking system on shared hosting (like cPanel, Hostinger, Bluehost, etc.).




###  Upload Files


1. **Upload the zip file** to your `public_html` folder (or `public_html/subdomain` if using subdomain) and extract

**Final Structure Should Look Like**:
```
/home/yourusername/
├── flight-booking/          ← Main Laravel files (hidden from web)
│   ├── app/
│   ├── bootstrap/
│   ├── config/
│   ├── database/
│   ├── resources/
│   ├── routes/
│   ├── storage/
│   ├── vendor/
│   ├── .env
│   └── artisan
│
            ← Web-accessible folder
    ├── index.php            ← From Laravel's public folder
    ├── .htaccess
    ├── css/
    ├── js/
    └── images/
```

## 🗄️ Step 3: Create Database

### 3.1 Create MySQL Database
1. Go to cPanel → **MySQL Databases**
2. Create a new database:
   - Database name: `yourusername_flightdb` (example)
   - Click "Create Database"
3. Create a database user:
   - Username: `yourusername_flight`
   - Password: Create a strong password (save it!)
   - Click "Create User"
4. Add user to database:
   - Select the database you created
   - Select the user you created
   - Grant "ALL PRIVILEGES"
   - Click "Add"

### 3.2 Note Your Database Credentials
Write down:
- Database name: `yourusername_flightdb`
- Database username: `yourusername_flight`
- Database password: (the one you created)
- Database host: `localhost` (usually)

## ⚙️ Step 4: Configure Environment File

### 4.1 Edit .env File
1. In File Manager,
2. Find the `.env` file (you may need to show hidden files)
 
3. Right-click → Edit
4. Update these settings:

```env
# Application Settings
APP_NAME="Flight Booking System"
APP_ENV=production
APP_DEBUG=false                          ← IMPORTANT: Set to false in production!
APP_URL=https://yourdomain.com          ← Your actual domain

# Database Configuration
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=yourusername_flightdb       ← Your database name
DB_USERNAME=yourusername_flight         ← Your database user
DB_PASSWORD=your_database_password      ← Your database password

# Mail Configuration (for sending emails)
MAIL_MAILER=smtp
MAIL_HOST=smtp.yourdomain.com          ← Ask your host provider
MAIL_PORT=587
MAIL_USERNAME=noreply@yourdomain.com
MAIL_PASSWORD=your_email_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@yourdomain.com
MAIL_FROM_NAME="${APP_NAME}"


```

5. **Save the .env**




### 6.2 Using phpMyAdmin (Alternative)
If you don't have terminal access:

1. Go to cPanel → phpMyAdmin
2. Select your database (`yourusername_flightdb`)
3. Click "Import" tab
4. import the sql file to the databse you created 





## ✅ Step 9: Test Your Installation

### 9.1 Access Your Website
1. Open browser and go to: `https://yourdomain.com`
2. You should see the flight booking homepage

### 9.2 Access Admin Panel
1. Go to: `https://yourdomain.com/adminlogin/remedylogin`
2. Login with the admin credentials email: admin@admin.com , password:admin123
3. You should see the admin dashboard

## 🛫 How to Create Airports and Flights

### Method 1: Using Admin Panel (Easiest)

#### Creating Airports:
1. **Login to Admin Panel**: `https://yourdomain.com/adminlogin/remedylogin`
2. **Navigate to Airports**:
   - Click "Flights" in the sidebar
   - Click "Manage Airports"
3. **Click "Create New Airport"** button
4. **Fill in Airport Details**:
   - **IATA Code**: 3-letter code (e.g., JFK, LAX, LHR)
   - **Airport Name**: Full name (e.g., "John F. Kennedy International Airport")
   - **City**: City name (e.g., "New York")
   - **Country**: Country name (e.g., "United States")
   - **Timezone**: Select from dropdown (e.g., "America/New_York")
   - **Latitude**: GPS coordinate (e.g., 40.6413)
   - **Longitude**: GPS coordinate (e.g., -73.7781)
5. **Click "Save Airport"**

**Example Airports to Create**:
```
JFK - John F. Kennedy International - New York, USA
LAX - Los Angeles International - Los Angeles, USA
LHR - London Heathrow - London, United Kingdom
DXB - Dubai International - Dubai, UAE
SIN - Singapore Changi - Singapore, Singapore
```

#### Creating Flights:
1. **Navigate to Flights**:
   - Click "Flights" in sidebar
   - Click "Create New Flight"
2. **Fill in Flight Details**:
   - **Airline**: Airline name (e.g., "American Airlines")
   - **Flight Number**: Code (e.g., "AA1001")
   - **Origin Airport**: Select from dropdown (airports you created)
   - **Destination Airport**: Select from dropdown
   - **Departure Time**: Time only (e.g., "08:00")
   - **Arrival Time**: Time only (e.g., "11:30")
   - **Start Date**: First day of schedule (e.g., "2025-11-16")
   - **End Date**: Last day of schedule (e.g., "2025-12-16")
   - **Frequency**: Choose how often:
     - Daily (every day)
     - Weekdays (Mon-Fri)
     - Weekends (Sat-Sun)
     - Weekly (once per week)
     - Every Other Day
   - **Terminal**: Terminal number (e.g., "4")
   - **Gate**: Gate number (e.g., "A12")
   - **Aircraft Type**: Plane model (e.g., "Boeing 777-300")
   - **Total Seats**: Number of seats (e.g., "300")
   - **Price**: Ticket price (e.g., "450.00")
   - **Airline Logo**: Upload airline logo image (optional)
3. **Click "Create Flight"**

The system will automatically create multiple flight instances based on:
- Date range (Start Date to End Date)
- Selected frequency
- Same departure/arrival times for each day

**Example Flight**:
```
Airline: Emirates
Flight Number: EK215
Route: DXB → SIN
Departure: 02:30
Arrival: 14:45
Dates: Nov 16, 2025 - Dec 16, 2025
Frequency: Daily
Price: $850
```

This will create 31 individual flights (one for each day from Nov 16 to Dec 16).



## 🔐 Security Checklist

Before going live:
- ✅ Set `APP_DEBUG=false` in `.env`
- ✅ Use strong passwords for database and admin account
- ✅ Install SSL certificate (HTTPS) - usually free with hosting
- ✅ Keep `.env` file secure (outside public_html)
- ✅ Update default email addresses
- ✅ Configure proper email SMTP settings
- ✅ Set up regular database backups
- ✅ Remove or secure phpMyAdmin access
- ✅ Keep Laravel and dependencies updated

## 🎉 You're Done!

Your flight booking system should now be running! 

**Next Steps**:
1. Login to admin panel
2. Create airports for your routes
3. Add flights and schedules
4. Configure payment gateways (bitcoin ,th, etc.)
5. Customize site settings and branding
6. Test the booking flow
7. Go live! ✈️
8 settings change site name and logo 
then in emails settings to setup email

**Admin Panel**: `https://yourdomain.com/adminlogin/remedylogin`
**User Site**: `https://yourdomain.com`

